package a.f.l;

import a.c.d;
import a.c.e;
import a.c.k;
import a.c.v;
import a.d.n;
import a.d.w;

class z
  extends y
{
  private a.c.z m;
  private a.c.z[] p = new a.c.z[2];
  private boolean s;
  private a.c.z w;
  private boolean x = false;
  private int y = -1;
  
  public z(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, boolean paramBoolean)
  {
    super(paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramBoolean);
  }
  
  public void a(d paramd, double paramDouble1, double paramDouble2, double paramDouble3)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (k == 0)
    {
      if (paramDouble1 >= h()) {
        if (k != 0) {
          break label43;
        }
      }
    }
    else {
      if (paramDouble1 <= i()) {
        break label39;
      }
    }
    return;
    label39:
    label43:
    double d1 = Math.min(paramDouble2, paramDouble3);
    paramDouble3 = Math.max(paramDouble2, paramDouble3);
    paramDouble2 = d1;
    if (k == 0) {
      if (paramDouble2 < j()) {
        paramDouble2 = j();
      }
    }
    if ((k != 0) || (paramDouble3 > k())) {
      paramDouble3 = k();
    }
    b_ localb_ = null;
    if ((k != 0) || (this.m == null))
    {
      this.m = new a.c.z();
      localb_ = new b_(paramd, paramDouble1, paramDouble2, paramDouble3);
      this.m.add(localb_);
    }
    else
    {
      int i = 0;
      v localv = this.m.f();
      label234:
      do
      {
        do
        {
          do
          {
            double d2;
            do
            {
              if (localv == null) {
                break label336;
              }
              if (j != 0) {
                break label343;
              }
              if (i != 0) {
                break label336;
              }
              d2 = ((b_)localv.c()).b;
              if (k != 0) {
                break label234;
              }
              if (d2 >= paramDouble1) {
                break;
              }
              localv = this.m.c(localv);
            } while ((k == 0) && (j == 0));
            if (k != 0) {
              break label333;
            }
            if (d2 != paramDouble1) {
              break label300;
            }
            d locald = ((b_)localv.c()).a;
            if (k != 0) {
              break label290;
            }
            if (locald == paramd) {
              break;
            }
            localv = this.m.c(localv);
            if (k != 0) {
              break label292;
            }
          } while (j == 0);
          i = 1;
          if (k != 0) {
            break label333;
          }
        } while (j == 0);
        localb_ = new b_(paramd, paramDouble1, paramDouble2, paramDouble3);
        localv = this.m.a(localb_, localv);
        i = 1;
      } while (j == 0);
      label290:
      label292:
      label300:
      label333:
      label336:
      if ((k == 0) && (i == 0))
      {
        label343:
        localb_ = new b_(paramd, paramDouble1, paramDouble2, paramDouble3);
        this.m.add(localb_);
      }
    }
  }
  
  public void v()
  {
    int j = g.Cc;
    int i = g.Bc;
    if (j == 0)
    {
      if (this.m == null) {
        return;
      }
      System.out.println("rp = " + this);
    }
    do
    {
      a.c.y localy = this.m.h();
      while (i == 0)
      {
        if (!localy.e()) {
          break;
        }
        System.out.println("  reg seg = " + (b_)localy.j());
        localy.f();
      }
    } while (j != 0);
  }
  
  public a.c.y w()
  {
    if ((g.Cc != 0) || (this.m != null)) {
      return this.m.h();
    }
    return null;
  }
  
  public void a(double paramDouble, boolean paramBoolean)
  {
    int n = g.Cc;
    int k = g.Bc;
    if (n == 0) {
      if (this.m == null) {
        return;
      }
    }
    double d1 = j();
    double d2 = k();
    int j = 0;
    a.c.y localy = this.m.h();
    do
    {
      if ((!localy.e()) || (j != 0)) {
        break;
      }
      b_ localb_ = (b_)localy.j();
      if (n == 0) {
        if (n != 0) {}
      }
      if (n == 0) {}
      int i = localb_.e == d2 ? 1 : paramBoolean ? 0 : localb_.c == d1 ? 1 : 0;
      if (n == 0)
      {
        if (i != 0)
        {
          if (n != 0) {
            continue;
          }
          if (paramDouble == localb_.b)
          {
            this.m.b(localy);
            j = 1;
          }
        }
        localy.f();
      }
    } while (k == 0);
  }
  
  public void b(d paramd, double paramDouble, boolean paramBoolean)
  {
    int n = g.Cc;
    int k = g.Bc;
    if (n == 0) {
      if (this.m == null) {
        return;
      }
    }
    double d1 = j();
    double d2 = k();
    int j = 0;
    a.c.y localy = this.m.h();
    do
    {
      if ((!localy.e()) || (j != 0)) {
        break;
      }
      b_ localb_ = (b_)localy.j();
      if (n == 0) {
        if (n != 0) {}
      }
      if (n == 0) {}
      int i = localb_.e == d2 ? 1 : paramBoolean ? 0 : localb_.c == d1 ? 1 : 0;
      if (n == 0)
      {
        if ((i != 0) && (paramd == localb_.a))
        {
          if (n != 0) {
            continue;
          }
          if (paramDouble == localb_.b)
          {
            this.m.b(localy);
            j = 1;
          }
        }
        localy.f();
      }
    } while (k == 0);
  }
  
  public void a(b_ paramb_)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (this.m == null) {
      return;
    }
    int i = 0;
    a.c.y localy = this.m.h();
    do
    {
      if ((!localy.e()) || (i != 0)) {
        break;
      }
      b_ localb_ = (b_)localy.j();
      if (k == 0)
      {
        if (localb_ == paramb_)
        {
          this.m.b(localy);
          i = 1;
        }
        localy.f();
      }
    } while (j == 0);
  }
  
  public b_ a(d paramd, boolean paramBoolean)
  {
    int n = g.Cc;
    int k = g.Bc;
    if (this.m == null) {
      return null;
    }
    Object localObject = null;
    double d1 = j();
    double d2 = k();
    int j = 0;
    a.c.y localy = this.m.h();
    if ((localy.e()) && (j == 0)) {}
    while (n != 0)
    {
      b_ localb_ = (b_)localy.j();
      if (n == 0) {
        if (n != 0) {}
      }
      if (n == 0) {}
      int i = localb_.e == d2 ? 1 : paramBoolean ? 0 : localb_.c == d1 ? 1 : 0;
      if (n == 0)
      {
        if ((i != 0) && (paramd == localb_.a))
        {
          localObject = localb_;
          j = 1;
        }
        localy.f();
      }
      if (k == 0) {
        break;
      }
    }
    return localObject;
  }
  
  public b_ a(d paramd)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (this.m == null) {
      return null;
    }
    Object localObject = null;
    double d1 = j();
    double d2 = k();
    int i = 0;
    a.c.y localy = this.m.h();
    do
    {
      if (!localy.e()) {
        break;
      }
      if (j != 0) {
        break label105;
      }
      b_ localb_ = (b_)localy.j();
      if (k == 0)
      {
        if (paramd == localb_.a)
        {
          localObject = localb_;
          i = 1;
        }
        localy.f();
      }
    } while (j == 0);
    label105:
    return localObject;
  }
  
  public void a(b_ paramb_, w paramw1, w paramw2)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (k == 0) {
      if (this.m == null) {
        return;
      }
    }
    if (this.e)
    {
      d1 = Math.min(paramw1.b, paramw2.b);
      d2 = Math.max(paramw1.b, paramw2.b);
      if (k != 0) {
        break label114;
      }
      if (j == 0) {}
    }
    else
    {
      d1 = Math.min(paramw1.a, paramw2.a);
      d2 = Math.max(paramw1.a, paramw2.a);
    }
    double d1 = Math.max(d1, j());
    double d2 = Math.min(d2, k());
    label114:
    b_ localb_ = new b_(paramb_.a, paramb_.b, d1, d2);
    int i = 0;
    v localv = this.m.f();
    label200:
    label204:
    label207:
    do
    {
      while (j == 0)
      {
        do
        {
          if ((localv == null) || (i != 0)) {
            break label207;
          }
          if (k != 0) {
            break label200;
          }
          if (localv.c() != paramb_) {
            break;
          }
          localv.a(localb_);
          i = 1;
          if (k != 0) {
            break label204;
          }
        } while (j == 0);
        localv = this.m.c(localv);
      }
    } while (k != 0);
  }
  
  public void a(b_ paramb_, double paramDouble)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (this.m == null) {
      return;
    }
    if ((k != 0) || (paramDouble >= h()))
    {
      if (k != 0) {
        break label53;
      }
      if (paramDouble <= i()) {}
    }
    else
    {
      return;
    }
    label53:
    if (k == 0) {
      if (paramDouble == paramb_.b) {
        return;
      }
    }
    int i = 0;
    label148:
    label202:
    label209:
    label212:
    label217:
    Object localObject2;
    if (paramDouble < paramb_.b)
    {
      localObject1 = this.m.f();
      do
      {
        do
        {
          do
          {
            double d2;
            do
            {
              if (localObject1 == null) {
                break label244;
              }
              if (j != 0) {
                break label250;
              }
              if (i != 0) {
                break label244;
              }
              d2 = ((b_)((v)localObject1).c()).b;
              if (k != 0) {
                break label148;
              }
              if (d2 >= paramDouble) {
                break;
              }
              localObject1 = this.m.c((v)localObject1);
            } while ((k == 0) && (j == 0));
            if (d2 != paramDouble) {
              break label212;
            }
            d locald2 = ((b_)((v)localObject1).c()).a;
            if (k != 0) {
              break label202;
            }
            if (locald2 == paramb_.a) {
              break;
            }
            localObject1 = this.m.c((v)localObject1);
            if (k != 0) {
              break label209;
            }
          } while (j == 0);
          i = 1;
          if (k != 0) {
            break label217;
          }
        } while (j == 0);
        paramb_.a(paramDouble);
        localObject2 = localObject1;
        this.m.a(paramb_, (v)localObject1);
        localObject1 = localObject2;
        i = 1;
      } while (j == 0);
      label244:
      if (k == 0) {
        label250:
        i = 0;
      }
      label323:
      label325:
      do
      {
        do
        {
          if ((localObject1 == null) || (i != 0)) {
            return;
          }
          b_ localb_ = (b_)((v)localObject1).c();
          if (k != 0) {
            break label323;
          }
          if (localb_.a != paramb_.a) {
            break;
          }
          this.m.h((v)localObject1);
          i = 1;
          if (k != 0) {
            break label325;
          }
        } while (j == 0);
        localObject1 = this.m.c((v)localObject1);
      } while (j == 0);
    }
    Object localObject1 = this.m.f();
    label407:
    label409:
    do
    {
      do
      {
        if (localObject1 == null) {
          break label412;
        }
        if (j != 0) {
          break label418;
        }
        if (i != 0) {
          break label412;
        }
        localObject2 = (b_)((v)localObject1).c();
        if (k != 0) {
          break label407;
        }
        if (localObject2 != paramb_) {
          break;
        }
        this.m.h((v)localObject1);
        i = 1;
        if (k != 0) {
          break label409;
        }
      } while (j == 0);
      localObject1 = this.m.c((v)localObject1);
    } while (j == 0);
    label412:
    if (k == 0) {
      label418:
      i = 0;
    }
    label485:
    do
    {
      do
      {
        do
        {
          double d1;
          do
          {
            if (localObject1 == null) {
              break label579;
            }
            if (j != 0) {
              break label586;
            }
            if (i != 0) {
              break label579;
            }
            d1 = ((b_)((v)localObject1).c()).b;
            if (k != 0) {
              break label485;
            }
            if (d1 >= paramDouble) {
              break;
            }
            localObject1 = this.m.c((v)localObject1);
          } while ((k == 0) && (j == 0));
          if (k != 0) {
            break label576;
          }
          if (d1 != paramDouble) {
            break label554;
          }
          d locald1 = ((b_)((v)localObject1).c()).a;
          if (k != 0) {
            break label544;
          }
          if (locald1 == paramb_.a) {
            break;
          }
          localObject1 = this.m.c((v)localObject1);
          if (k != 0) {
            break label546;
          }
        } while (j == 0);
        i = 1;
        if (k != 0) {
          break label576;
        }
      } while (j == 0);
      paramb_.a(paramDouble);
      localObject1 = this.m.a(paramb_, (v)localObject1);
      i = 1;
    } while (j == 0);
    label544:
    label546:
    label554:
    label576:
    label579:
    if ((k == 0) && (i == 0))
    {
      label586:
      paramb_.a(paramDouble);
      this.m.add(paramb_);
    }
  }
  
  public double x()
  {
    int i = g.Cc;
    if ((i != 0) || (this.m != null))
    {
      if (i != 0) {
        break label40;
      }
      if (!this.m.isEmpty()) {}
    }
    else
    {
      return (0.0D / 0.0D);
    }
    label40:
    b_ localb_ = (b_)this.m.d();
    return localb_.b;
  }
  
  public double y()
  {
    int i = g.Cc;
    if ((i != 0) || (this.m != null))
    {
      if (i != 0) {
        break label40;
      }
      if (!this.m.isEmpty()) {}
    }
    else
    {
      return (0.0D / 0.0D);
    }
    label40:
    b_ localb_ = (b_)this.m.a();
    return localb_.b;
  }
  
  public int b(boolean paramBoolean)
  {
    int j = g.Cc;
    if (j == 0) {}
    int i = paramBoolean ? 0 : 1;
    if (j == 0) {
      if (this.p[i] == null) {
        return 0;
      }
    }
    return this.p[i].size();
  }
  
  public a_ a(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    int j = g.Cc;
    if (j == 0) {}
    int i = paramBoolean ? 0 : 1;
    if ((j != 0) || (this.p[i] == null)) {
      this.p[i] = new a.c.z();
    }
    a_ locala_ = new a_(paramDouble1, paramDouble2);
    this.p[i].add(locala_);
    return locala_;
  }
  
  public void e(double paramDouble)
  {
    int k = g.Cc;
    int j = g.Bc;
    int i = 0;
    label113:
    label123:
    label126:
    do
    {
      do
      {
        while (k != 0)
        {
          if (i >= 2) {
            break label126;
          }
          if ((k != 0) || (this.p[i] != null))
          {
            a.c.y localy = this.p[i].h();
            do
            {
              if (!localy.e()) {
                break label113;
              }
              a_ locala_ = (a_)localy.j();
              if (j != 0) {
                break;
              }
              if (paramDouble == locala_.a)
              {
                this.p[i].b(localy);
                if (k != 0) {
                  break label123;
                }
                if (j == 0) {
                  break label113;
                }
              }
              localy.f();
            } while (j == 0);
          }
          i++;
        }
      } while (j == 0);
    } while (k != 0);
  }
  
  public a.c.z e(boolean paramBoolean)
  {
    if (g.Cc == 0) {}
    int i = paramBoolean ? 0 : 1;
    return this.p[i];
  }
  
  public void g(boolean paramBoolean)
  {
    int j = g.Cc;
    System.out.println("____DEBUG_printEstCoordsSpaceInfos()");
    if (j == 0) {}
    int i = paramBoolean ? 0 : 1;
    if (j == 0)
    {
      if (this.p[i] == null)
      {
        if (j != 0) {
          break label115;
        }
        System.out.println("  no estimated coords[" + i + "] available");
      }
    }
    else if (g.Bc == 0) {
      return;
    }
    label115:
    System.out.println("  estimated coords[" + i + "] = " + this.p[i]);
  }
  
  public void h(boolean paramBoolean)
  {
    this.s = paramBoolean;
  }
  
  public boolean z()
  {
    return this.s;
  }
  
  public void j(boolean paramBoolean)
  {
    int j = g.Cc;
    if (j == 0) {}
    int i = paramBoolean ? 0 : 1;
    if ((j != 0) || (this.p[i] != null)) {
      this.p[i].clear();
    }
  }
  
  public void b(b_ paramb_)
  {
    int k = g.Cc;
    int j = g.Bc;
    if ((k != 0) || (paramb_.b >= j()))
    {
      if (k != 0) {
        break label54;
      }
      if (paramb_.b <= k()) {}
    }
    else
    {
      return;
    }
    label54:
    if (k == 0)
    {
      if (paramb_.e > h()) {
        if (k != 0) {
          break label88;
        }
      }
    }
    else {
      if (paramb_.c < i()) {
        break label80;
      }
    }
    return;
    label80:
    label88:
    double d1 = Math.max(h(), paramb_.c);
    double d2 = Math.min(i(), paramb_.e);
    b_ localb_ = null;
    if ((k != 0) || (this.w == null))
    {
      this.w = new a.c.z();
      localb_ = new b_(paramb_.a, paramb_.b, d1, d2);
      this.w.add(localb_);
      this.x = true;
    }
    else
    {
      int i = 0;
      v localv = this.w.f();
      label252:
      do
      {
        do
        {
          do
          {
            double d3;
            do
            {
              if (localv == null) {
                break label362;
              }
              if (j != 0) {
                break label369;
              }
              if (i != 0) {
                break label362;
              }
              d3 = ((b_)localv.c()).b;
              if (k != 0) {
                break label252;
              }
              if (d3 >= paramb_.b) {
                break;
              }
              localv = this.w.c(localv);
            } while ((k == 0) && (j == 0));
            if (k != 0) {
              break label359;
            }
            if (d3 != paramb_.b) {
              break label321;
            }
            d locald = ((b_)localv.c()).a;
            if (k != 0) {
              break label311;
            }
            if (locald == paramb_.a) {
              break;
            }
            localv = this.w.c(localv);
            if (k != 0) {
              break label313;
            }
          } while (j == 0);
          i = 1;
          if (k != 0) {
            break label359;
          }
        } while (j == 0);
        localb_ = new b_(paramb_.a, paramb_.b, d1, d2);
        localv = this.w.a(localb_, localv);
        i = 1;
      } while (j == 0);
      label311:
      label313:
      label321:
      label359:
      label362:
      if ((k == 0) && (i == 0))
      {
        label369:
        localb_ = new b_(paramb_.a, paramb_.b, d1, d2);
        this.w.add(localb_);
      }
    }
  }
  
  public boolean a(double paramDouble1, double paramDouble2, d paramd)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (this.w == null) {
      return false;
    }
    int i = 0;
    boolean bool = false;
    a.c.y localy = this.w.h();
    label144:
    label160:
    do
    {
      if (!localy.e()) {
        break;
      }
      if (j != 0) {
        break label174;
      }
      if (i != 0) {
        break;
      }
      b_ localb_ = (b_)localy.j();
      if (k == 0) {
        if (localb_.b == paramDouble2)
        {
          if (k != 0) {
            break label144;
          }
          if (localb_.a != paramd)
          {
            if (k != 0) {
              continue;
            }
            if (paramDouble1 < localb_.c) {
              break label160;
            }
            if (k != 0) {
              continue;
            }
            if (paramDouble1 > localb_.e) {
              break label160;
            }
            i = 1;
            bool = true;
            if (k != 0) {
              continue;
            }
            if (j == 0) {
              break label160;
            }
          }
        }
      }
      if (k == 0)
      {
        if (localb_.b > paramDouble2) {
          i = 1;
        }
        localy.f();
      }
    } while (j == 0);
    label174:
    return bool;
  }
  
  public void A()
  {
    int i = g.Cc;
    if (((i != 0) || (this.w != null)) && ((i != 0) || (this.x))) {
      this.w.clear();
    }
  }
  
  public int a(k paramk1, k paramk2)
  {
    int k = g.Cc;
    int j = g.Bc;
    if (k == 0) {
      if (this.y != -1) {
        return this.y;
      }
    }
    int i = 0;
    double d = h() - 1.0D;
    a.c.y localy = this.m.h();
    do
    {
      if (!localy.e()) {
        break;
      }
      b_ localb_ = (b_)localy.j();
      if (j != 0) {
        break label108;
      }
      if (localb_.b > d)
      {
        i++;
        d = localb_.b;
      }
      localy.f();
    } while (j == 0);
    label108:
    return i;
  }
  
  static class a_
  {
    public double a;
    public double c;
    public e d;
    public boolean e;
    
    a_(double paramDouble1, double paramDouble2)
    {
      this.a = paramDouble1;
      this.c = paramDouble2;
    }
    
    public String toString()
    {
      String str = "c=" + this.a + "/l=" + this.c;
      return str;
    }
  }
  
  static class b_
  {
    public final d a;
    public double b;
    public final double c;
    public final double e;
    public n f;
    
    b_(d paramd, double paramDouble1, double paramDouble2, double paramDouble3)
    {
      this.a = paramd;
      this.b = paramDouble1;
      double d = Math.max(paramDouble2, paramDouble3);
      this.c = Math.min(paramDouble2, paramDouble3);
      this.e = d;
    }
    
    private void a(double paramDouble)
    {
      this.b = paramDouble;
    }
    
    public void a(n paramn)
    {
      this.f = paramn;
    }
    
    public n a()
    {
      return this.f;
    }
    
    public String toString()
    {
      return "[e=" + this.a + "; coord=" + this.b + "; from=" + this.c + "; to=" + this.e + "]";
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.z

 * JD-Core Version:    0.7.0.1

 */